<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <meta name="author" content="姚德秋">
    <title></title>
    <style>
        *{
            box-sizing: border-box;
        }
      nav{
          width: 100%;
          height: 50px;
          background-color: black;
      }
      nav .list-left{
          width: 1000px;
          float: left;
          display: flex;
          justify-content: flex-end;
      }
      ul{
          margin: 0;
          padding: 0;
          list-style: none;
      }
      nav .list-left li{
          /* float: left; */

          /* margin-right: 0; */
          margin: 0 30px;
      }
      a{
          text-decoration: none;
          color: white;
          text-align: center;
          line-height: 50px;
      }
      nav .list-right{
          width: 600px;
          float: right;
          display: flex;
          justify-content: center;
          color: white;
          line-height: 50px;
}
    .list-right li{
        margin-right: 20px;
    }
    section{
        position: absolute;
        text-align: center;
        color: white;
    }
    .frist-section{
        width: 120px;
        height: 100px;
        background-color: black;
        top: 56px;
        left: 360px;
         display: none; 
    }
    .last-section{
        width: 120px;
        height: 200px;
        background-color: black;
        top: 56px;
        left: 470px;
         display: none; 
    }
    p{
        margin: 0;
        width: 120px;
        height: 50px;
        line-height: 50px;
        /* border: 1px border-style color; */
    }
    #shouye a{
       color: yellowgreen;
    }
    </style>
</head>
<body>
    <nav>
        <ul class="list-left">
            <li id="shouye"><a href="#">会员首页</a></li>
            <li class="mv"><a href="#">看电影</a></li>
            <li class="kj"><a href="#">看剧</a></li>
            <li><a href="#">看动漫</a></li>
            <li><a href="#">纪录片</a></li>
            <li><a href="#">德云社</a></li>
            <li><a href="#">看直播</a></li>
        </ul>
        <ul class="list-right">
            <li>我的会员</li>
            <li>会员卡</li>
        </ul>
        <section class="frist-section">
            <!-- <p>看电影</p> -->
            <p>华语电影</p>
            <p>海外大片</p>
        </section>
        <section class="last-section">
            <p>英剧</p>
            <p>美剧</p>
            <p>港剧</p>
            <p>韩剧</p>
            <!-- <p></p> -->
        </section>
    </nav>
</body>
</html>
<script>
       var fristSection = document.querySelectorAll(".frist-section p")
       var lastSection  = document.querySelectorAll(".last-section p")  
       var lis = document.querySelectorAll(".list-left li a")  
       var mv = document.querySelector(".mv")   
       var fsc = document.querySelector(".frist-section")
       var kj = document.querySelector(".kj")
       var lsc = document.querySelector(".last-section")
        for(var i = 0;i<fristSection.length;i++){
            fristSection[i].index = i;
             fristSection[i].onmouseover = function(){
                 this.style.backgroundColor = "red";
             }
             fristSection[i].onmouseout = function(){
                 this.style.backgroundColor = "black";
             }
        }
        for(var j = 0;j<lastSection.length;j++){
            lastSection[j].index = j;
            lastSection[j].onmouseover = function(){
                this.style.backgroundColor = "red";
            }
            lastSection[j].onmouseout = function(){
                this.style.backgroundColor = "black";
            }
        }
        for(var i = 0;i<lis.length;i++){
            lis[i].index = i;
            lis[i].onmouseover = function(){
                this.style.color ="green";
            }
            lis[i].onmouseout = function(){
                this.style.color = "white";
            }
        }
        fsc.onmouseover = function(){
            fsc.style.display = "block"
        }
        fsc.onmouseout = function(){
            fsc.style.display = "none"
        }
        mv.onmouseover = function(){
              fsc.style.display = "block"
        }
        mv.onmouseout = function(){
            fsc.style.display = "none"
        }
         lsc.onmouseover = function(){
            lsc.style.display = "block"
        }
        lsc.onmouseout = function(){
            lsc.style.display = "none"
        }
        kj.onmouseover = function(){
              lsc.style.display = "block"
        }
        kj.onmouseout = function(){
            lsc.style.display = "none"
        }


</script>